3.157 \(\int \frac{\cos ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\)

Optimal. Leaf size=224 \[ \frac{i a^2}{48 d (a+i a \tan (c+d x))^6}-\frac{7 i}{256 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{21 i}{256 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{256 d \left (a^2-i a^2 \tan (c+d x)\right )^2}+\frac{15 i}{256 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{7 x}{64 a^4}+\frac{3 i a}{80 d (a+i a \tan (c+d x))^5}+\frac{3 i}{64 d (a+i a \tan (c+d x))^4}+\frac{5 i}{96 a d (a+i a \tan (c+d x))^3} \]

[Out]

(7*x)/(64*a^4) + ((I/48)*a^2)/(d*(a + I*a*Tan[c + d*x])^6) + (((3*I)/80)*a)/(d*(a + I*a*Tan[c + d*x])^5) + ((3
*I)/64)/(d*(a + I*a*Tan[c + d*x])^4) + ((5*I)/96)/(a*d*(a + I*a*Tan[c + d*x])^3) - (I/256)/(d*(a^2 - I*a^2*Tan
[c + d*x])^2) + ((15*I)/256)/(d*(a^2 + I*a^2*Tan[c + d*x])^2) - ((7*I)/256)/(d*(a^4 - I*a^4*Tan[c + d*x])) + (
(21*I)/256)/(d*(a^4 + I*a^4*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.124897, antiderivative size = 224, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ \frac{i a^2}{48 d (a+i a \tan (c+d x))^6}-\frac{7 i}{256 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{21 i}{256 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{256 d \left (a^2-i a^2 \tan (c+d x)\right )^2}+\frac{15 i}{256 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{7 x}{64 a^4}+\frac{3 i a}{80 d (a+i a \tan (c+d x))^5}+\frac{3 i}{64 d (a+i a \tan (c+d x))^4}+\frac{5 i}{96 a d (a+i a \tan (c+d x))^3} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(7*x)/(64*a^4) + ((I/48)*a^2)/(d*(a + I*a*Tan[c + d*x])^6) + (((3*I)/80)*a)/(d*(a + I*a*Tan[c + d*x])^5) + ((3
*I)/64)/(d*(a + I*a*Tan[c + d*x])^4) + ((5*I)/96)/(a*d*(a + I*a*Tan[c + d*x])^3) - (I/256)/(d*(a^2 - I*a^2*Tan
[c + d*x])^2) + ((15*I)/256)/(d*(a^2 + I*a^2*Tan[c + d*x])^2) - ((7*I)/256)/(d*(a^4 - I*a^4*Tan[c + d*x])) + (
(21*I)/256)/(d*(a^4 + I*a^4*Tan[c + d*x]))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cos ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \frac{1}{(a-x)^3 (a+x)^7} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \left (\frac{1}{128 a^7 (a-x)^3}+\frac{7}{256 a^8 (a-x)^2}+\frac{1}{8 a^3 (a+x)^7}+\frac{3}{16 a^4 (a+x)^6}+\frac{3}{16 a^5 (a+x)^5}+\frac{5}{32 a^6 (a+x)^4}+\frac{15}{128 a^7 (a+x)^3}+\frac{21}{256 a^8 (a+x)^2}+\frac{7}{64 a^8 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac{i a^2}{48 d (a+i a \tan (c+d x))^6}+\frac{3 i a}{80 d (a+i a \tan (c+d x))^5}+\frac{3 i}{64 d (a+i a \tan (c+d x))^4}+\frac{5 i}{96 a d (a+i a \tan (c+d x))^3}-\frac{i}{256 d \left (a^2-i a^2 \tan (c+d x)\right )^2}+\frac{15 i}{256 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{7 i}{256 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{21 i}{256 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{(7 i) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{64 a^3 d}\\ &=\frac{7 x}{64 a^4}+\frac{i a^2}{48 d (a+i a \tan (c+d x))^6}+\frac{3 i a}{80 d (a+i a \tan (c+d x))^5}+\frac{3 i}{64 d (a+i a \tan (c+d x))^4}+\frac{5 i}{96 a d (a+i a \tan (c+d x))^3}-\frac{i}{256 d \left (a^2-i a^2 \tan (c+d x)\right )^2}+\frac{15 i}{256 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{7 i}{256 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{21 i}{256 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.495187, size = 142, normalized size = 0.63 \[ \frac{\sec ^4(c+d x) (-560 \sin (2 (c+d x))+840 i d x \sin (4 (c+d x))+105 \sin (4 (c+d x))+144 \sin (6 (c+d x))+10 \sin (8 (c+d x))+1120 i \cos (2 (c+d x))+105 (8 d x+i) \cos (4 (c+d x))-96 i \cos (6 (c+d x))-5 i \cos (8 (c+d x))+525 i)}{7680 a^4 d (\tan (c+d x)-i)^4} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(Sec[c + d*x]^4*(525*I + (1120*I)*Cos[2*(c + d*x)] + 105*(I + 8*d*x)*Cos[4*(c + d*x)] - (96*I)*Cos[6*(c + d*x)
] - (5*I)*Cos[8*(c + d*x)] - 560*Sin[2*(c + d*x)] + 105*Sin[4*(c + d*x)] + (840*I)*d*x*Sin[4*(c + d*x)] + 144*
Sin[6*(c + d*x)] + 10*Sin[8*(c + d*x)]))/(7680*a^4*d*(-I + Tan[c + d*x])^4)

________________________________________________________________________________________

Maple [A]  time = 0.1, size = 196, normalized size = 0.9 \begin{align*}{\frac{-{\frac{7\,i}{128}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{{a}^{4}d}}+{\frac{{\frac{3\,i}{64}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{{\frac{i}{48}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{6}}}-{\frac{{\frac{15\,i}{256}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}+{\frac{3}{80\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{5}}}-{\frac{5}{96\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{21}{256\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{256}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) +i \right ) ^{2}}}+{\frac{{\frac{7\,i}{128}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{4}d}}+{\frac{7}{256\,{a}^{4}d \left ( \tan \left ( dx+c \right ) +i \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x)

[Out]

-7/128*I/d/a^4*ln(tan(d*x+c)-I)+3/64*I/d/a^4/(tan(d*x+c)-I)^4-1/48*I/d/a^4/(tan(d*x+c)-I)^6-15/256*I/d/a^4/(ta
n(d*x+c)-I)^2+3/80/d/a^4/(tan(d*x+c)-I)^5-5/96/d/a^4/(tan(d*x+c)-I)^3+21/256/d/a^4/(tan(d*x+c)-I)+1/256*I/d/a^
4/(tan(d*x+c)+I)^2+7/128*I/d/a^4*ln(tan(d*x+c)+I)+7/256/d/a^4/(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.3894, size = 379, normalized size = 1.69 \begin{align*} \frac{{\left (1680 \, d x e^{\left (12 i \, d x + 12 i \, c\right )} - 15 i \, e^{\left (16 i \, d x + 16 i \, c\right )} - 240 i \, e^{\left (14 i \, d x + 14 i \, c\right )} + 1680 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 1050 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 560 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 210 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 48 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 5 i\right )} e^{\left (-12 i \, d x - 12 i \, c\right )}}{15360 \, a^{4} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/15360*(1680*d*x*e^(12*I*d*x + 12*I*c) - 15*I*e^(16*I*d*x + 16*I*c) - 240*I*e^(14*I*d*x + 14*I*c) + 1680*I*e^
(10*I*d*x + 10*I*c) + 1050*I*e^(8*I*d*x + 8*I*c) + 560*I*e^(6*I*d*x + 6*I*c) + 210*I*e^(4*I*d*x + 4*I*c) + 48*
I*e^(2*I*d*x + 2*I*c) + 5*I)*e^(-12*I*d*x - 12*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]  time = 1.52514, size = 328, normalized size = 1.46 \begin{align*} \begin{cases} \frac{\left (- 202661983231672320 i a^{28} d^{7} e^{46 i c} e^{4 i d x} - 3242591731706757120 i a^{28} d^{7} e^{44 i c} e^{2 i d x} + 22698142121947299840 i a^{28} d^{7} e^{40 i c} e^{- 2 i d x} + 14186338826217062400 i a^{28} d^{7} e^{38 i c} e^{- 4 i d x} + 7566047373982433280 i a^{28} d^{7} e^{36 i c} e^{- 6 i d x} + 2837267765243412480 i a^{28} d^{7} e^{34 i c} e^{- 8 i d x} + 648518346341351424 i a^{28} d^{7} e^{32 i c} e^{- 10 i d x} + 67553994410557440 i a^{28} d^{7} e^{30 i c} e^{- 12 i d x}\right ) e^{- 42 i c}}{207525870829232455680 a^{32} d^{8}} & \text{for}\: 207525870829232455680 a^{32} d^{8} e^{42 i c} \neq 0 \\x \left (\frac{\left (e^{16 i c} + 8 e^{14 i c} + 28 e^{12 i c} + 56 e^{10 i c} + 70 e^{8 i c} + 56 e^{6 i c} + 28 e^{4 i c} + 8 e^{2 i c} + 1\right ) e^{- 12 i c}}{256 a^{4}} - \frac{7}{64 a^{4}}\right ) & \text{otherwise} \end{cases} + \frac{7 x}{64 a^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((-202661983231672320*I*a**28*d**7*exp(46*I*c)*exp(4*I*d*x) - 3242591731706757120*I*a**28*d**7*exp(4
4*I*c)*exp(2*I*d*x) + 22698142121947299840*I*a**28*d**7*exp(40*I*c)*exp(-2*I*d*x) + 14186338826217062400*I*a**
28*d**7*exp(38*I*c)*exp(-4*I*d*x) + 7566047373982433280*I*a**28*d**7*exp(36*I*c)*exp(-6*I*d*x) + 2837267765243
412480*I*a**28*d**7*exp(34*I*c)*exp(-8*I*d*x) + 648518346341351424*I*a**28*d**7*exp(32*I*c)*exp(-10*I*d*x) + 6
7553994410557440*I*a**28*d**7*exp(30*I*c)*exp(-12*I*d*x))*exp(-42*I*c)/(207525870829232455680*a**32*d**8), Ne(
207525870829232455680*a**32*d**8*exp(42*I*c), 0)), (x*((exp(16*I*c) + 8*exp(14*I*c) + 28*exp(12*I*c) + 56*exp(
10*I*c) + 70*exp(8*I*c) + 56*exp(6*I*c) + 28*exp(4*I*c) + 8*exp(2*I*c) + 1)*exp(-12*I*c)/(256*a**4) - 7/(64*a*
*4)), True)) + 7*x/(64*a**4)

________________________________________________________________________________________

Giac [A]  time = 1.18837, size = 198, normalized size = 0.88 \begin{align*} -\frac{-\frac{420 i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a^{4}} + \frac{420 i \, \log \left (-i \, \tan \left (d x + c\right ) - 1\right )}{a^{4}} + \frac{30 \,{\left (21 i \, \tan \left (d x + c\right )^{2} - 49 \, \tan \left (d x + c\right ) - 29 i\right )}}{a^{4}{\left (\tan \left (d x + c\right ) + i\right )}^{2}} + \frac{-1029 i \, \tan \left (d x + c\right )^{6} - 6804 \, \tan \left (d x + c\right )^{5} + 19035 i \, \tan \left (d x + c\right )^{4} + 29080 \, \tan \left (d x + c\right )^{3} - 25995 i \, \tan \left (d x + c\right )^{2} - 13332 \, \tan \left (d x + c\right ) + 3317 i}{a^{4}{\left (\tan \left (d x + c\right ) - i\right )}^{6}}}{7680 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/7680*(-420*I*log(-I*tan(d*x + c) + 1)/a^4 + 420*I*log(-I*tan(d*x + c) - 1)/a^4 + 30*(21*I*tan(d*x + c)^2 -
49*tan(d*x + c) - 29*I)/(a^4*(tan(d*x + c) + I)^2) + (-1029*I*tan(d*x + c)^6 - 6804*tan(d*x + c)^5 + 19035*I*t
an(d*x + c)^4 + 29080*tan(d*x + c)^3 - 25995*I*tan(d*x + c)^2 - 13332*tan(d*x + c) + 3317*I)/(a^4*(tan(d*x + c
) - I)^6))/d